#include <opencv2/core/types_c.h>

#include "Sobel.h"
#include "../utils/Logger.h"

Sobel::Sobel(int xOrder, int yOrder, int aperture) :
        xOrder(xOrder),
        yOrder(yOrder),
        aperture(aperture)
{
}

Sobel::~Sobel() {
}

IplImage* Sobel::apply(const IplImage* in) {
    Log << "Applying sobel effect: " <<
            xOrder << ", " <<
            yOrder << ", " <<
            aperture << endl;
    IplImage *out = cvCreateImage(cvSize(in->width, in->height), IPL_DEPTH_32F, in->nChannels);
    cvSobel(in, out, xOrder, yOrder, aperture);
    return out;
}
